'; // Loop round and create an option element for each month (Jan - Dec) for ($i = 1; $i <= 12; $i++) { // Start the option element echo '\t'; } // Close the select element echo ''; // -------------------------------------------------------------------------- // Start off with the drop-down for Days // Start opening the select element echo ''; // -------------------------------------------------------------------------- // Finally, the drop-down for Years // Start opening the select element echo ''; } function selectTime($hour = 0, $min = 0, $ap = 'pm',$var_h = 'hour',$var_m = 'min',$var_ap='ampm') { $printHour = 0; $printMin = 0; if($hour == 0) $printHour = 9; else $printHour = $hour; if($min == 0) $printMin = 0; else $printMin = $min; $startHour = 1; echo "\n"; $startMin = 0; echo "\n"; echo "\n"; } $mysql_datetime = date('Y-m-d H:i:s'); $mysql_date = date('Y-m-d'); $mysql_time = date('H:i:s'); function convertPHPTimeToMySQLTime($hour,$minute,$ampm) { if($ampm == "am") { if ($hour == 12) return "0".":".$minute.":00"; else return $hour.":".$minute.":00"; } else { if ($hour == 12) return "12".":".$minute.":00"; else return ($hour+12).":".$minute.":00"; } } function convertPHPDateToMySQLDate($day,$month,$year) { return str_pad($year, 2, "0", STR_PAD_LEFT)."-".str_pad($month, 2, "0", STR_PAD_LEFT)."-".str_pad($day, 2, "0", STR_PAD_LEFT); } function getDay($str) { $pieces = explode("-", $str); return $pieces[2]; } function getMonth($str) { $pieces = explode("-", $str); return $pieces[1]; } function getYear($str) { $pieces = explode("-", $str); return $pieces[0]; } function getHour($str) { $pieces = explode(":",$str); if($pieces[0] > 12) $pieces[0] -= 12; if($pieces[0] == "00") $pieces[0] = 12; return $pieces[0]; } function getMin($str) { $pieces = explode(":",$str); return $pieces[1]; } function getAP($str) { $pieces = explode(":",$str); if($pieces[0] >= 12) return "pm"; return "am"; } function dateFromMysqlToNormal($str) { return date("D, F jS Y", strtotime($str)); } function timeFromMysqlToNormal($str) { return date("h:i A", strtotime($str)); } ?>